﻿using Model;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class ContestInfoServices
    {
        public static List<ContestInfo> ArrangementSelect()
        {
            List<ContestInfo> conlist = new List<ContestInfo>();
            string sql = "select * from Arrangement";
            DataTable dt = DBHelper.GetDataTable(sql);
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                ContestInfo con = new ContestInfo()
                {
                    ArrID = Convert.ToInt32(dt.Rows[i]["ArrID"]),
                    TimeContent = Convert.ToDateTime(dt.Rows[i]["TimeContent"]),
                    Step = dt.Rows[i]["Step"].ToString(),
                    Concrete = dt.Rows[i]["Concrete"].ToString(),
                };
                conlist.Add(con);
            }
            return conlist;
        }
    }
}